/**
 * 
 */
package cvcg.dto;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @author jaracje
 *
 */
public class Top5ResultDTO 
{
	private String gameName;
	private Long gameId;	
	private Map<String,Integer> voters = new HashMap<String,Integer>();
	public String getGameName() {
		return gameName;
	}
	public void setGameName(String gameName) {
		this.gameName = gameName;
	}
	public Map<String, Integer> getVoters() {
		return voters;
	}
	public void setVoters(Map<String, Integer> voters) {
		this.voters = voters;
	}

	public void addVoter(String name,Integer points) 
	{
		voters.put(name, points);
	}
		
	public Integer getPointsByPlayer(String playerName) 
	{
		return voters.get(playerName);
	}
	public Long getGameId() {
		return gameId;
	}
	public void setGameId(Long gameId) {
		this.gameId = gameId;
	}
	
	public Integer getPoints() 
	{
		Collection<Integer> points = voters.values();
		Integer total = Integer.valueOf(0);
		for (Integer p : points) 
		{
			total = total + p;
		}
		
		return total;
	}

}
